1 Google Cloud Set Up

This tutorial is mainly based on Tudip 2019.

1.1 Create or log in to a GCP account

  • Here is the URL you will need to access in order to request a Google Cloud Platform 300 $ coupon and 12 month of free usage:
  • Student Coupon Retrieval Link

1.2 Create or select a GCP project

  • In order to setup an instance, you need to select or create a project in GCP:

Source: Tudip 2019.

1.3 Setup a VM instance

  • In a new project, you must enable billing to use Compute Engine Service.
  • Go to Compute Engine > VM instance and click ā€œEnable billingā€.

Source: Tudip 2019.

  • Click ā€œCreateā€ to create a new VM instance with the configurations below:

Instance Name:
Select your nearest region and zone.
Region: …
Zone: bspw. us-central1-a
Machine Type: select ā€œn1-standard-1 (1 vCPU, 3,75 GB Speicherplatz) (You can increase the memory as per your need)
Boot Disk: Ubuntu 16.04 LTS
Boot disk type: Standard Persistent disk
Size(GB): 10
Keep ā€œIdentity and API accessā€ as default.
Firewall: Click the checkbox to allow both HTTP and HTTPS traffic.
Click ā€œManagement, security, disks, networking, sole tenancyā€ to expand and go to Disks section.
Uncheck ā€œDelete boot disk when the instance is deletedā€ deletion rule.

Click on the ā€œCreateā€ button.

1.4 Make External IP as Static

  • In order to access the Jupyter notebook, we need to make External Ip as static.
  • Go to Networking > VPC Network > External IP addresses.
  • You will see an external IP address of your instance, change the type from Ephemeral to Static.
  • You will see a popup window where you need to provide a name for the new static IP address and click Reserve.
  • Note: Make a note of your external IP address, you will require it later.

1.5 Create Firewall Rules

  • On the same path, click Firewall rules (Networking > VPC Network > Firewall rules) and Click ā€œCREATE FIREWALL RULEā€ with below configuration:

Name:
Targets: All instances in the network
Source IP ranges: 0.0.0.0/0
Protocols and ports: Select ā€œSpecified protocols and portsā€ option.
tcp: 8888
Keep other configuration as default.

Click on the Create button.

Source: Tudip 2019.

Now your instance is ready!

1.6 Install Anaconda

We now follow the steps provided in this tutorial.

  • Once your server is set up and running, SHH to your server and download the latest installer bash script:

Source: Tudip 2019.

  • In SSH type line by line:
sudo apt update
sudo apt upgrade
cd /tmp
  • This will download the latest Anaconda installer.
curl -O https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh
  • Once the download is completed, you can run the installer to install Anaconda.
bash Anaconda3-2019.10-Linux-x86_64.sh
  • Press Enter to continue the installation and type yes to accept when prompted.

  • Press Enter to confirm the location and you will need to agree to install Anaconda in the confirmed location.

  • Activate and Test Anaconda

  • To activate the installation in your same terminal session run the following commands.

cd ~/
source ~/.bashrc

Verify the Anaconda installation with the conda command.

conda list
  • Now Anaconda is installed successfully on your Ubuntu 18.04 LTS on Google Cloud Compute Engine.

1.7 Setup the VM server

  • Enter the commands below to create and configure the Jupyter configurations files:
jupyter notebook --generate-config
vi ~/.jupyter/jupyter_notebook_config.py
  • Press ā€œiā€ to insert and add the following lines in the configuration file:
c = get_config()
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
  • Once you are done with making changes, press Esc
  • Type :wq to save and exit from the file.

1.8 Launch Jupyter Notebook

Run the command below:

jupyter notebook

1.9 Install MLflow

  • In SSH type:
conda install -c conda-forge mlflow